<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Pc_Api_Standard_Communal extends Controller_Pc_Api_Base
{

    //公共功能控制器
    public function before()
    {
        parent::before();
    }

    //获得预订须知
    public function action_agreement()
    {
        $tpinyin=Common::remove_xss($this->request_body->content->tpinyin);//需要获得须知的类别
        $tpinyin=empty($tpinyin)?'member':$tpinyin;//默认为member
        $agreemento='cfg_'.$tpinyin.'_agreement_open';
        $agreement='cfg_'.$tpinyin.'_agreement';
        $agreements='cfg_'.$tpinyin.'_agreement_selected';
        $fields = array($agreemento, $agreement,$agreements);
        $config = Model_Sysconfig::get_configs(0, $fields);
        $trueconfig=array(
            'content'=>Model_Api_Standard_Xcx::filter_content($config[$agreement]),
            'selected'=>$config[$agreements],
            'open'=>$config[$agreemento]
        );
        $this->send_datagrams($this->client_info['id'], $trueconfig, $this->client_info['secret_key']);
    }
}